package mirrormonkey.state.messages;

import com.jme3.network.Message;
import com.jme3.network.serializing.Serializable;

@Serializable
public class StateUpdateMessage implements Message {

	public int entityId;

	public int[] fieldIds;

	public Object[] fieldValues;

	public long localTime;

	public float estimatedRemoteTime;

	public boolean reliable;

	public StateUpdateMessage() {
	}

	public StateUpdateMessage(int entityId, int[] fieldIds,
			Object[] fieldValues, long localTime, boolean reliable) {
		this.entityId = entityId;
		this.fieldIds = fieldIds;
		this.fieldValues = fieldValues;
		this.localTime = localTime;
		this.reliable = reliable;
	}

	@Override
	public boolean isReliable() {
		return reliable;
	}

	@Override
	public Message setReliable(boolean reliable) {
		this.reliable = reliable;
		return this;
	}

}
